package com.collaboration.proton.services;

import com.collaboration.proton.dao.SingleAgencyInfoRepository;
import com.collaboration.proton.entities.Player;
import com.collaboration.proton.entities.SingleAgencyInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * @author vybfi
 * @param 无
 * @return 无
 *
 */
@Service
public class SingleAgencyInfoService {
    @Autowired
    SingleAgencyInfoRepository singleAgencyInfoRepository;

    public List<SingleAgencyInfo> getAll() {

        return singleAgencyInfoRepository.findAll();
    }

    public SingleAgencyInfo save(SingleAgencyInfo singleAgencyInfo) {
        return singleAgencyInfoRepository.save(singleAgencyInfo);
    }

    public List<SingleAgencyInfo> findAllByPlayer(Player player){
        return singleAgencyInfoRepository.findAllByPlayer(player);
    }
}
